package _05_stack.my_implements;

import _05_stack.Stack;
import org.junit.Assert;
import org.junit.Test;

import java.util.ArrayList;

/**
 * @author: mornd
 * @dateTime: 2023/6/6 - 16:26
 */
public class MyTest {

    void unitTest(Stack<Integer> stack) {
        stack.push(1);
        stack.push(2);
        stack.push(3);
        System.out.println(stack.peek());
        System.out.println(stack.pop());
        stack.push(4);
        for (Integer i : stack) {
            System.out.println(i);
        }
        System.out.println();
    }


    @Test
    public void test1() {
        unitTest(new LinkedListStack(2));
    }

    @Test
    public void test2() {
        unitTest(new ArrayStack(2));
    }


}
